<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>登录页面</title>
    <script type="text/javascript" src="js/jquery.min.js"></script>
</head>
<body>
    <h3>登录页面</h3>
    <form method="post" id="loginForm">
        用户名:<input type="text" name="username"/><br/>
        密码:<input type="password" name="password"/><br/>
        <input type="button" id="loginBtn" value="登录"/>
    </form>
    <script type="text/javascript">
        $(function () {
            $("#loginBtn").click(function () {
                $.post("/securityLogin",$("#loginForm").serialize(),function (data) {
                    if(data.success){
                        window.location.href="/product/index";
                    }else{
                        alert("登录失败："+data.errorMsg);
                    }
                },"json");
            }) ;
        });

    </script>
</body>
</html>